#!/usr/bin/env bash

set -e

export _DIR=$(cd "$(dirname "$0")"; pwd)
export SCRIPT_NAME=`realpath $0`
export PID=$$
cd $_DIR

if ! hash yarn 2>/dev/null; then
curl -o- -L https://yarnpkg.com/install.sh | bash
yarn config set registry 'https://registry.npm.taobao.org'
fi

if ! hash coffee 2>/dev/null; then
yarn global add coffeescript
fi

cd $_DIR
if [ ! -d node_modules ]; then
yarn --ignore-engines
fi

